package com.micromsg.common.core;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageResult<E> {

    private Long total;

    private List<E> dataList;

    // 静态方法，用于快速创建 PageResult 对象
    public static <E> PageResult<E> of(Long total, List<E> dataList) {
        return new PageResult<>(total, dataList);
    }

    // 静态方法，用于快速创建 PageResult 对象
    public static <E> PageResult<E> of(int total, List<E> dataList) {
        return new PageResult<>(Long.valueOf(total), dataList);
    }
}
